STEP 7: Examples Using the randomGroovoid Static Method

This example simply demonstrates the different kinds of results that can be achieved by passing different parameter values to the randomGroovoid static method. Clicking on the following links will play Groovoids that are randomly selected from different main categories. Because the selection is truly random, you may sometimes get the same Groovoid selected twice in a row. This is especially noticable in Groovoid categories that only contain a small number of Groovoids, such as the "Misc" category.


Copy-and-Paste
<CENTER>

<SCRIPT SRC="javascript/music-object.js"></SCRIPT>
<SCRIPT SRC="javascript/music-object-x-dynamic.js"></SCRIPT>

<SCRIPT LANGUAGE=JavaScript><!-- //

groovoid = new Music ();

groovoid.magicEmbed (
   'SRC="music/stub.rmf" ' +
   'AUTOSTART=TRUE ' +
   'DISPLAY=SONG ' +
   'MODE=COPYRIGHT ' +
   'LOOP=FALSE ' +
   'VOLUME=100'
);

// --></SCRIPT>

<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5>
   <TR>
      <TD>
         <UL>
            <LI>
               <A
                  HREF="javascript://"
                  ONCLICK="groovoid.play (Music.randomGroovoid ('Background'))"
               >
                  Play a random "Background" Groovoid
               </A>
            <LI>
               <A
                  HREF="javascript://"
                  ONCLICK="groovoid.play (Music.randomGroovoid ('Fanfare'))"
               >
                  Play a random "Fanfare" Groovoid
               </A>
            <LI>
               <A
                  HREF="javascript://"
                  ONCLICK="groovoid.play (Music.randomGroovoid ('Hits'))"
               >
                  Play a random "Hits" Groovoid
               </A>
            <LI>
               <A
                  HREF="javascript://"
                  ONCLICK="groovoid.play (Music.randomGroovoid ('Hits-Kicker'))"
               >
                  Play a random "Hits-Kicker" Groovoid
               </A>
            <LI>
               <A
                  HREF="javascript://"
                  ONCLICK="groovoid.play (Music.randomGroovoid ('Misc'))"
               >
                  Play a random "Misc" Groovoid
               </A>
            <LI>
               <A
                  HREF="javascript://"
                  ONCLICK="groovoid.play (Music.randomGroovoid ('UI'))"
               >
                  Play a random "UI" Groovoid
               </A>
            <LI>
               <A
                  HREF="javascript://"
                  ONCLICK="groovoid.play (Music.randomGroovoid ('UI-Click'))"
               >
                  Play a random "UI-Click" Groovoid
               </A>
            <LI>
               <A
                  HREF="javascript://"
                  ONCLICK="groovoid.play (Music.randomGroovoid ('UI-MouseOver'))"
               >
                  Play a random "UI-MouseOver" Groovoid
               </A>
            <LI>
               <A
                  HREF="javascript://"
                  ONCLICK="groovoid.play (Music.randomGroovoid ('UI-Notification'))"
               >
                  Play a random "UI-Notification" Groovoid
               </A>
            <LI>
               <A
                  HREF="javascript://"
                  ONCLICK="groovoid.play (Music.randomGroovoid ('UI-OpenOrClose'))"
               >
                  Play a random "UI-OpenOrClose" Groovoid
               </A>
         </UL>
      </TD>
   </TR>
</TABLE>
<P>
</CENTER>